﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Idlesoft.ShellAnywhereLanguage
{
	public abstract class Verb : Target, IVerb
	{
		#region ctors
		public Verb(string value) : base(value) { }
		#endregion ctors

		#region props
		[XmlIgnore]
		public override LexemeType LexemeType { get { return LexemeType.Verb; } }
		#endregion props

		#region methods
		public abstract bool CanExecute(ITarget target, params IParam[] paramz);
		public void Execute(ITarget target, params IParam[] exprs)
		{
			if (DoExecute != null)
				DoExecute(target, exprs);
			else
				throw new ArgumentException("wtf");
		}
		#endregion methods

		#region events
		public event Action<ITarget, IParam[]> DoExecute;
		#endregion events
	}
}
